{include file="public/layout" /}
<body style="background-color: #FFF; overflow-y: scroll;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    {include file="system/bar" /}
    <form method="post" id="handlepost" action="{:U('System/web2')}" enctype="multipart/form-data" name="form1">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">系统模式</dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="web_cmsmode2" class="cb-enable {if condition="!isset($config.web_cmsmode) || $config.web_cmsmode eq 2"}selected{/if}" >开发模式</label>
                        <label for="web_cmsmode1" class="cb-disable {if condition="isset($config.web_cmsmode) && $config.web_cmsmode eq 1"}selected{/if}" >运营模式</label>
                        <input id="web_cmsmode2" onClick="set_cmsmode(2)" name="web_cmsmode" value="2" {if condition="!isset($config.web_cmsmode) || $config.web_cmsmode eq 2"}checked{/if} type="radio">
                        <input id="web_cmsmode1" onClick="set_cmsmode(1)" name="web_cmsmode"  value="1" {if condition="isset($config.web_cmsmode) && $config.web_cmsmode eq 1"}checked{/if} type="radio">
                    </div>
                    <br/>
                    <p class="">开发模式：方便修改模板，及时预览前台效果，没缓存，一改便生效。<br/>运营模式：提高前台响应速度，利于收录；改模板及后台发布内容需执行【<a href="{:U('System/clear_cache')}">更新缓存</a>】后才能在前台展示。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="site_url">升级弹窗提醒</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="web_show_popup_upgrade1" class="cb-enable {if condition='!isset($config.web_show_popup_upgrade) || $config.web_show_popup_upgrade eq 1'}selected{/if}">开启</label>
                        <label for="web_show_popup_upgrade0" class="cb-disable {if condition='isset($config.web_show_popup_upgrade) && $config.web_show_popup_upgrade eq -1'}selected{/if}">关闭</label>
                        <input id="web_show_popup_upgrade1" name="web_show_popup_upgrade" value="1" type="radio" {if condition="!isset($config.web_show_popup_upgrade) || $config.web_show_popup_upgrade eq 1"} checked="checked"{/if}>
                        <input id="web_show_popup_upgrade0" name="web_show_popup_upgrade" value="-1" type="radio" {if condition="isset($config.web_show_popup_upgrade) && $config.web_show_popup_upgrade eq -1"} checked="checked"{/if}>
                    </div>
                    <p class="notic">开启之后，第一时间收到系统更新提醒</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="site_url">强制启用https</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="web_is_https1" class="cb-enable {if condition='isset($config.web_is_https) && $config.web_is_https eq 1'}selected{/if}">开启</label>
                        <label for="web_is_https0" class="cb-disable {if condition='empty($config.web_is_https)'}selected{/if}">关闭</label>
                        <input id="web_is_https1" name="web_is_https" value="1" type="radio" {if condition="isset($config.web_is_https) && $config.web_is_https eq 1"} checked="checked"{/if}>
                        <input id="web_is_https0" name="web_is_https" value="0" type="radio" {if condition="empty($config.web_is_https)"} checked="checked"{/if}>
                    </div>
                    <p class="notic">开启之后，sitemap.xml地图以及全站URL将带有https头协议</p>
                    <p class="">开启前，请先在空间正确配置SSL证书。<br/>在能正常访问https://域名的情况下，才开启这个功能，使整站的URL都强制采用https协议访问。</p>
                </dd>
            </dl>
            <dl class="row none">
                <dt class="tit">
                    <label for="web_cmspath">系统安装目录</label>
                </dt>
                <dd class="opt">
                    <input id="web_cmspath" name="web_cmspath" value="{$config.web_cmspath|default=''}" class="input-txt" type="text" />
                    <p class="notic">目录后面不要带 / 反斜杆，一般适用于EyouCms安装在子目录</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="adminbasefile">新后台地址</label>
                </dt>
                <dd class="opt">
                    __SITE_URL____ROOT_DIR__/<input type="hidden" name="adminbasefile_old" value="{$adminbasefile|default='login'}"><input id="adminbasefile" name="adminbasefile" value="{$adminbasefile|default='login'}" type="text" data-site_url="__SITE_URL__" onKeyUp="this.value=this.value.replace(/[^0-9a-zA-Z_-]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9a-zA-Z_-]/g,''));" style="width: 80px;" />.php
                    <p class="notic">为了提高后台的安全性，请及时更改后台入口文件。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="web_sqldatapath">数据库备份目录</label>
                </dt>
                <dd class="opt">
                    __ROOT_DIR__<input id="web_sqldatapath" name="web_sqldatapath" value="{$config.web_sqldatapath|default=$sqlbackuppath}" class="input-txt" type="text" />
                    <p class="notic"></p>
                </dd>
            </dl>
<!--             <dl class="row">
                <dt class="tit">
                    <label for="site_url">启用绝对网址</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="web_multi_site1" class="cb-enable {if condition='isset($config.web_multi_site) AND $config.web_multi_site eq 1'}selected{/if}">是</label>
                        <label for="web_multi_site0" class="cb-disable {if condition='!isset($config.web_multi_site) OR empty($config.web_multi_site)'}selected{/if}">否</label>
                        <input id="web_multi_site1" name="web_multi_site" value="1" type="radio" {if condition="isset($config.web_multi_site) AND $config.web_multi_site eq 1"} checked="checked"{/if}>
                        <input id="web_multi_site0" name="web_multi_site" value="0" type="radio" {if condition="!isset($config.web_multi_site) OR empty($config.web_multi_site)"} checked="checked"{/if}>
                    </div>
                    <p class="notic">启用绝对网址，开启此项后附件、栏目连接、arclist内容等都使用http路径</p>
                </dd>
            </dl> -->
            <div class="bot">
                <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onClick="adsubmit();">确认提交</a>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function adsubmit(){
        var adminbasefileObj = $('input[name=adminbasefile]');
        var adminbasefile_oldObj = $('input[name=adminbasefile_old]');
        if($.trim(adminbasefileObj.val()) == ''){
            showErrorMsg('新后台地址不能为空！');
            adminbasefileObj.focus();
            return false;
        }
        if(adminbasefile_oldObj.val() != adminbasefileObj.val()){
            var flag = false;
            var site_url = adminbasefileObj.data('site_url');
            layer.confirm('新后台地址：<font color="red">'+site_url+'__ROOT_DIR__/'+adminbasefileObj.val()+'.php</font>，确认更改？', {
                    title: false,
                    btn: ['继续更改','取消'] //按钮
                }, function(){
                    layer_loading('正在处理');
                    $('#handlepost').submit();
                }, function(index){
                    flag = false;
                }
            );
            return flag;
        }
        layer_loading('正在处理');
        $('#handlepost').submit();
    }

    function set_cmsmode(type){
        if(1 == type){
            $('#dl_web_htmlcache_expires_in').show();
        }else{
            $('#dl_web_htmlcache_expires_in').hide();
        }
    }

    function tag_call(name)
    {
        $.ajax({
            type: "POST",
            url: "{:url('System/ajax_tag_call')}",
            data: {name:name},
            dataType: 'json',
            success: function (res) {
                if(res.code == 1){
                    //询问框
                    var confirm = layer.confirm(res.data.msg, {
                            title: false,
                            area: ['60%','80%'],
                            btn: ['关闭'] //按钮

                        }, function(){
                            layer.close(confirm);
                        }
                    );  
                }else{
                    layer.alert(res.msg, {icon: 2, title:false});
                }
            },
            error:function(){
                layer.alert('网络失败，请刷新页面后重试', {icon: 2, title:false});
            }
        });
    }
</script>

{include file="public/footer" /}